﻿
<script>
    var tempmodel = avalon.define({
        $id: "LSGL", 
        modelData: { "LeiBie": "公司", "Phone": "", "LinkUser": "", "UserAddress": "", "QQ": "", "Email": "", "GSName": "", "GYSAddress": "", "mobilePhone": "", "YWFW": "", "Remark": "" },
        iswf: false,//是否属于流程表单
        inittemp: function (strId) { 
            if (strId) {
                //编辑加载数据
                $.getJSON('/API/FTAPI.ashx?Action=GETGYSGLMODEL', { P1: strId }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        tempmodel.modelData = resultData.Result;
                        setTimeout(" ComFunJS.initForm()", 500)
                    }
                })
            } else {
                ComFunJS.initForm()
            }
        },//初始化
        SaveData: function (btdom, piid) {
            var data = tempmodel.modelData.$model;
            var modelValue = JSON.stringify(data);
            $.post("/API/FTAPI.ashx?ACTION=ADDGYSGL", { P1: modelValue }, function (result) {
                var jsonresult = $.parseJSON(result)
                btdom.removeClass("disabled").find("i").hide();
                if ($.trim(jsonresult.ErrorMsg) == "") {
                    ComFunJS.winsuccessnew("操作成功");
                }
            });
        },
    });
   
</script>
<div class="form-horizontal" ms-controller="LSGL">
    <div class="form-group">
        <label class="col-xs-2 control-label"> <span class="Required">*</span>公司类别 </label>
        <div class="col-xs-3">
            <select ms-duplex="modelData.LeiBie" class="form-control">
                <option value="个人">个人</option>
                <option value="公司">公司</option>
            </select>
        </div> 
        <label class="col-xs-2 control-label"><span class="Required">*</span>公司名称</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.GSName" class="form-control szhl_require" />
        </div> 
    </div>
    <div class="form-group">
        <label class="col-xs-2 control-label">公司地址</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.GYSAddress" class="form-control " />
        </div>
        <label class="col-xs-2 control-label">公司电话</label>
        <div class="col-xs-3">
            <input type="text" value="" ms-duplex="modelData.mobilePhone" class="form-control " />
        </div>
    </div>
        <div class="form-group">
            <label class="col-xs-2 control-label"><span class="Required">*</span>联系人</label>
            <div class="col-xs-3">
                <input type="text" value="" ms-duplex="modelData.LinkUser" class="form-control szhl_require" />
            </div>
            <label class="col-xs-2 control-label"><span class="Required">*</span>联系人手机</label>
            <div class="col-xs-3">
                <input type="text" value="" ms-duplex="modelData.Phone" class="form-control szhl_require" />
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 control-label"><span class="Required">*</span>QQ</label>
            <div class="col-xs-3">
                <input type="text" value="" ms-duplex="modelData.QQ" class="form-control " />
            </div>
            <label class="col-xs-2 control-label"><span class="Required">*</span>邮箱</label>
            <div class="col-xs-3">
                <input type="text" value="" ms-duplex="modelData.Email" class="form-control " />
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 control-label"><span class="Required">*</span>联系人地址</label>
            <div class="col-xs-8">
                <input type="text" value="" ms-duplex="modelData.UserAddress" class="form-control" />
            </div>
        </div> 
        <div class="form-group">
            <label class="col-xs-2 control-label">业务范围</label>
            <div class="col-xs-8">
                <textarea id="conLSJS" ms-duplex="modelData.YWFW" class="szhl_UEEDIT form-control "></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 control-label">备注</label>
            <div class="col-xs-8">
                <textarea id="conRemark" ms-duplex="modelData.Remark" class="szhl_UEEDIT form-control "></textarea>
            </div>
        </div>
    </div>
